package com.jy.oms.framework.asyn.task.web;

/**
 * vo
 *
 * @author liuquan
 */
public class TaskQueueResponse<T> {

    private boolean success;

    private String msg;

    private T data;

    public TaskQueueResponse() {
    }

    public TaskQueueResponse(boolean success, T data) {
        this.success = success;
        this.data = data;
    }

    public static <T> TaskQueueResponse success(){
        return new TaskQueueResponse().setSuccess(true);
    }

    public static <T> TaskQueueResponse success(T data){
        return new TaskQueueResponse().setSuccess(true).setData(data);
    }

    public static TaskQueueResponse failure(String msg){
        return new TaskQueueResponse().setSuccess(false).setMsg(msg);
    }

    public boolean isSuccess() {
        return success;
    }

    public TaskQueueResponse<T> setSuccess(boolean success) {
        this.success = success;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public TaskQueueResponse<T> setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public T getData() {
        return data;
    }

    public TaskQueueResponse<T> setData(T data) {
        this.data = data;
        return this;
    }
}
